<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>

    <script src="js/jQuery.min.js"></script>
</head>

<body>
    <h1>登录页面</h1>
    <div>
        <div>
            <span>账号:</span>
            <input type="text" id="username">
        </div>
        <div>
            <span>密码:</span>
            <input type="password" id="password">
        </div>
        <button onclick="login()">登录</button>
    </div>


    <script>
        function login() {
            var username = jQuery("#username").val();
            var password = jQuery("#password").val();
            jQuery.ajax({
                type: "POST",
                url: "/user/login",
                data: {
                    username,
                    password
                },
                success: function (data) {
                    alert(data);
                }
            });
        }
    </script>

</body>


</html>